﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;
using Microsoft.Xna.Framework;

namespace UIComponentSprite.Date
{
    /// <summary>
    /// 日期背景图片
    /// </summary>
    public class DateBackGroundSprite : UserControlledSprite
    {
        private DateSprite _dateSprite=new DateSprite();
        private SeasonSprite _seasonSprite=new SeasonSprite();
        private CurrentForceSprite _currentForceSprite=new CurrentForceSprite();
        public DateBackGroundSprite()
        {
            this.ImgUrl = @"Images\views\date\Background";
            DrawPosition.Width = 342;
            DrawPosition.Height = 78;
        }
        public override void Draw(GameTime gameTime)
        {
            if (!Showing)
                return;
            SpriteBatch.Draw(this.Image, DrawPosition, Color.White);
            _dateSprite.Draw(gameTime);
            _seasonSprite.Draw(gameTime);
            _currentForceSprite.Draw(gameTime);
        }

        public override void Update(GameTime gameTime)
        {
            if (!Showing)
                return;
            LoadPic();
            _dateSprite.Update(gameTime);
            _seasonSprite.Update(gameTime);
            _currentForceSprite.Update(gameTime);
        }
    }
}
